import Vue from 'vue'
import Router from 'vue-router'
import main from '@/views/main'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'main',
      component: main,
      redirect: '/login',
      children: [{
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login'),
        meta: { name: '登录盛大车险保险平台' }
      },
      {
        path: '/register',
        name: 'register',
        component: () => import('@/views/Register'),
        meta: { name: '注册盛大车险保险平台' }
      },
      {
        path: '/forget',
        name: 'forget',
        component: () => import('@/views/forgetPwd'),
        meta: { name: '忘记密码' }
      },
      {
        path: '/content',
        name: 'content',
        redirect: '/mine',
        component: () => import('@/views/content'),
        children: [{
          path: '/mine',
          name: 'mine',
          component: () => import('@/views/content/mine'),
          meta: { name: '个人中心' }
        }, {
          path: '/unauthority',
          name: 'unauthority',
          component: () => import('@/views/unAuthority'),
          meta: { name: '账号状态' }
        }]
      }]
    }]
})

// export default new Router({
//   scrollBehavior: () => ({ y: 0 }),
//   routes: whiteRouter
// })
